#!/usr/bin/env python
# vim: set filetype=python expandtab tabstop=2 shiftwidth=2 autoindent smartindent:
# -*- coding: utf-8 -*-
#

from google.appengine.ext import webapp
from google.appengine.ext import db
import os

class Point(db.Expando):
  """ save a point with a comment """
  
  lat   = db.StringProperty(required=True)
  lng   = db.StringProperty(required=True)
  comment = db.StringProperty(required=True)

# test print envs
class SavePoint(webapp.RequestHandler):
  def get(self):
      
    lat = self.request.get('lat')
    lng = self.request.get('lng')
    comment = self.request.get('comment')
    
    p = Point(lat=lat, lng=lng, comment=comment)
    key = p.put()
    
    self.response.out.write('Point (%s,%s [%s]) Saved with key (%d) Succ!' % (lat, lng, comment, key.id_or_name()))
